package org.nicocube.airain.domain.server.criteria;

import com.db4o.query.Query;

/**
 * Build a basic query constraint for finding all the object that has the value of a column equaling a value
 * 
 * @author nicolas
 * @version 0.1
 * 
 * @param <T>
 */
public class ConstraintCriteria<T> extends AbstractCriteria {
	private T value;

	public ConstraintCriteria(String column,T value) {
		super(column);
		this.value=value;
	}
	
	public T getValue() {
		return value;
	}
	
	@Override
	public void apply(Query q) {
		q.descend(getColumn()).constrain(getValue());
	}

}
